package org.jeecg.modules.param.maintain.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.param.maintain.entity.BikePileLock;
import org.jeecg.modules.param.maintain.mapper.BikePileLockMapper;
import org.jeecg.modules.param.maintain.service.IBikePileLockService;
import org.jeecg.modules.param.maintain.vo.BikePileLockRsp;
import org.jeecg.modules.utils.ExcelUtils;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @Description: 运维开关锁记录
 * @Author: 月月鸟
 * @Date:   2021-07-13
 * @Version: V1.0
 */
@Service
public class BikePileLockServiceImpl extends ServiceImpl<BikePileLockMapper, BikePileLock> implements IBikePileLockService {
    @Resource
    private BikePileLockMapper bikePileLockMapper;
    @Override
    public Page<BikePileLockRsp> pageWebList(Page<BikePileLockRsp> page, BikePileLockRsp bikePileLockRsp) {
        List<BikePileLockRsp> list =  bikePileLockMapper.pageWebList(page,bikePileLockRsp);
        return page.setRecords(list);
    }

    @Override
    public Page<BikePileLockRsp> pageAdminList(Page<BikePileLockRsp> page, BikePileLockRsp bikePileLockRsp) {
        List<BikePileLockRsp> list =  bikePileLockMapper.pageAdminList(page,bikePileLockRsp);
        return page.setRecords(list);
    }

    @Override
    public ModelAndView exportXlsAdmin(HttpServletRequest request, BikePileLockRsp bikePileLockRsp) {
        return ExcelUtils.exportXls(request,bikePileLockMapper.adminList(bikePileLockRsp),BikePileLockRsp.class,"运维开关锁记录");
    }

    @Override
    public ModelAndView exportXlsWeb(HttpServletRequest request, BikePileLockRsp bikePileLockRsp) {
        return ExcelUtils.exportXls(request,bikePileLockMapper.webList(bikePileLockRsp),BikePileLockRsp.class,"后台开关锁记录");
    }
}
